<?php

/**
 * Catalog page
 *
 * This script loads the catalog module specified in the 'view' request variable
 * and displays the output.  If an invalid module, or no module, is specified, 
 * the script will redirect the user to the default page.
 *
 * Shopalong, the open source shopping system
 * http://shopalong.blogspot.com/
 *
 * @author Stuart Metcalfe <shoopdev@gmail.com>
 * @copyright Copyright &copy; 2006, Shopalong
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 */

require('includes/application_top.php');

if (isset($HTTP_GET_VARS['view']) && tep_not_null($HTTP_GET_VARS['view']))
{
	$module = $catalog->getModule($HTTP_GET_VARS['view']);
	
	if (tep_not_null($module))
	{
		$theme->assign_by_ref('module', $module);
		$theme->display($module->getTemplate());
	}
	
	else
	{
		tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'SSL'));
	}
}

else
{
	tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'SSL'));
}

require(DIR_WS_INCLUDES.'application_bottom.php');

?>
